class Solution
{
public:
    int multiply(int A, int B)
    {
        if (A == 0 || B == 0)
        {
            return 0;
        }
        else
        {
            int ans = 0;
            ans += multiply(A, B - 1) + A;
            return ans;
        }
    }
};